# -*- coding:utf-8 -*-
from ncclient import manager
def h3c_connection(host, port, user, password):
    return manager.connect(host=host,
                           port=port,
                           username=user,
                           password=password,
                           hostkey_verify=False,
                           device_params={'name': "h3c"},
                           allow_agent=False,
                           look_for_keys=False)


def test_connect(host, port, user, password):
    with h3c_connection(host, port=port, user=user, password=password) as m:
        n = m._session.id
        print("This session id is %s." % (n))


if __name__ == '__main__':
     test_connect("192.168.56.120", 830, "admin", "123456")
    # test_connect(sys.argv[1:],sys.argv[2:],sys.argv[3:],sys.argv[4:])